<template>
	<view class="itu-demo">
		<view class="itu-demo-wrap">
			<view class="itu-demo-title">演示效果</view>
			<view class="itu-demo-area">
				<view class="itu-demo-result-line">
					<text>日期：</text>
					<text @click="chooseDate('startDate')">{{ result[0]||'' }}</text>
					<text>至</text>
					<text @click="chooseDate('endDate')">{{ result[1]||'' }}</text>
				</view>
			</view>
		</view>
		<itu-date-picker shape="round" :default-value="result" :current="current" v-model="isShow" :is-mask-close="true" @confirm="confirm"></itu-date-picker>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				result: ['2021-01-01', '2021-02-01'],
				current: "",
				isShow: false,
			}
		},
		onLoad({title}) {
			this.setNavigationBarTitle(title)
		},
		methods: {
			confirm(e){
				this.result = e;
				this.isShow = false;
			},
			chooseDate(param){
				this.current = param;
				this.isShow = true;
			}
		}
	}
</script>

<style>

</style>
